{% extends "base.html" %}
{% block title %}首页 - 学生管理系统{% endblock %}

{% block content %}
<div class="layui-body">
    <div style="padding: 15px;">

        <!-- 面包屑导航 -->
        <div class="layui-row">
            <div class="layui-col-md12">
                <span class="layui-breadcrumb">
                  <a href="#">首页</a>
                </span>
            </div>
        </div>

        <!-- 卡片统计 -->
        <div class="layui-row layui-col-space15" style="margin-top: 15px;">
            <div class="layui-col-md4">
                <div class="layui-card">
                    <div class="layui-card-header">学生总数</div>
                    <div class="layui-card-body">
                        {{ students.paginator.count }} 人
                    </div>
                </div>
            </div>
            <div class="layui-col-md4">
                <div class="layui-card">
                    <div class="layui-card-header">班级总数</div>
                    <div class="layui-card-body">
                        {{ grades.paginator.count }} 个
                    </div>
                </div>
            </div>
            <div class="layui-col-md4">
                <div class="layui-card">
                    <div class="layui-card-header">今日新增</div>
                    <div class="layui-card-body">
                        {{ today_students.count }} 人
                    </div>
                </div>
            </div>
        </div>

        <!-- 搜索框 -->
        {% include "components/search_box.html" with keyword=keyword placeholder="请输入学生姓名或学号" %}

        <!-- 学生表格 -->
        {% include "components/table_student.html" with students=students %}

        <!-- 分页控件 -->
        {% include "components/pagination.html" with elem_id="student-page" count=students.paginator.count current_page=students.number keyword=keyword %}
    </div>
</div>
{% endblock %}
